home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / cross / ava-0.2.5.lha / ava-0.2.5 / src / Avr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-23  |  1.2 KB  |  62 lines

  1. /*
  2.     Avr.h
  3.     
  4.     AVR Family Machine Code Generator
  5.     Uros Platise, (c) 1998
  6. */
  7.  
  8. #ifndef __AVR
  9. #define __AVR
  10.  
  11. #include "Global.h"
  12.  
  13. class TAvr: public TArch {
  14. private:
  15.   enum TToDo {Nothing=0, NegateBits=1, WrapAround=2};
  16.   
  17.   struct TInstSet {        /* instruction entry */
  18.     char name [6];
  19.     char arg [4];
  20.     char opcode [17];
  21.     char chk [2];
  22.     char model;
  23.   };  
  24.   struct TConstSet {
  25.     char name [4];
  26.     int  val;
  27.   };      
  28.   static TInstSet instSet [];
  29.   static TConstSet regSet [];  
  30.   int noInst;            /* number of instruction in database */
  31.   int noReg;
  32.   int instLevel;        /* instruction level support */
  33.   TInstSet* ip;            /* current instruction */
  34.   TConstSet* rp;        /* current register */
  35.   
  36.   /* BUG hunters */
  37.   bool bug_skip_instruction;
  38.   bool bug_check_skip_bug;
  39.  
  40. private:
  41.   void CheckCoreBugs();
  42.   TConstSet* is_Register (const char* str);  
  43.                   /* Check and Modify Range of
  44.                    Constants and Address Space */
  45.   TToDo checK(int cArg, long res); 
  46.   void parseIndexRegs(int cArg);/* Aux. parsing functions ... */                  
  47.   void out_GAS(int cArg);    /* Aux. output functions ... */ 
  48.   
  49. public:
  50.   TAvr ();
  51.   ~TAvr ();
  52.  
  53.   char* Device(char* buf);
  54.   void IsSameDevice();
  55.   int is_Arch ();
  56.   void Parse ();
  57.   void Translate(int instruction);
  58. };
  59.  
  60. #endif
  61.  
  62.